import { requireModule } from '@/utils/mpHelper'

type Echarts = typeof echarts
let echartsLib: Echarts | null = null
export async function loadEcharts() {
  if (echartsLib) return echartsLib
  echartsLib = await requireModule('/extLib/echarts.js')
  return echartsLib
}

export function getEcharts(): Echarts {
  return echartsLib as Echarts
}
